package com.macro.mall.tiny.modules.ums.controller;

import com.macro.mall.tiny.modules.ums.dto.UmsAdminParam;
import lombok.SneakyThrows;

import java.lang.reflect.Method;

public class Test05 {

    @SneakyThrows
    public static void main(String[] args) {
            Class<?> aClass = Class.forName("com.macro.mall.tiny.modules.ums.controller.Myclass");
            Object o = aClass.newInstance();
//            Method login = aClass.getDeclaredMethod("login", String.class, String.class);
            Method login = aClass.getDeclaredMethod("login1", UmsAdminParam.class);
            UmsAdminParam umsAdminParam=new UmsAdminParam();
            umsAdminParam.setNickName("123");
            Object admin = login.invoke(o, umsAdminParam);
            System.out.println(admin);//Object一定已经重写过toString方法


    }
}
